package com.pur.zsms.pmsnmanage.role.service;

import java.util.List;

import com.pur.zsms.common.exception.GenericException;
import com.pur.zsms.common.support.PageController;
import com.pur.zsms.common.support.PaginationSupport;
import com.pur.zsms.pmsnmanage.menu.po.MenuPo;
import com.pur.zsms.pmsnmanage.role.po.RoleMenuPo;
import com.pur.zsms.pmsnmanage.role.po.RolePo;
import com.pur.zsms.pmsnmanage.role.vo.RoleVo;
import com.pur.zsms.pmsnmanage.user.po.UserPo;
import com.pur.zsms.pmsnmanage.user.po.UserRolePo;
import com.pur.zsms.systemsetting.datadictionary.po.CodeType;
import com.pur.zsms.systemsetting.datadictionary.vo.CodeVo;

/**
 * 角色接口
 * 
 * @author xin
 * 
 */
public interface IRoleService {

	/**
	 * 查询角色信息
	 * 
	 * @param
	 * @return
	 */
	public PaginationSupport listRole(PageController pageController, RoleVo roleVo) throws GenericException;

	/**
	 * 新增角色信息
	 */
	public void addRole(RoleVo c) throws GenericException;

	/**
	 * 修改角色信息
	 */
	public void updateRole(RoleVo c) throws GenericException;

	/**
	 * 删除角色信息
	 */
	/* public void deleteRole(String roleId)throws GenericException ; */

	/**
	 * 查询所有菜单信息
	 * 
	 * @author liyuxin
	 * @param
	 * @return
	 */
	public List<MenuPo> listAllMenu() throws GenericException;

	/**
	 * 添加角色菜单
	 * 
	 * @author liyuxin
	 * @param roleVo
	 * @param menuIds
	 * @throws GenericException
	 */
	public void addRoleMenu(RoleVo roleVo, Long[] menuIds) throws GenericException;

	public void addRoleMenu(RoleVo roleVo) throws GenericException;

	/**
	 * 通过ID查找角色
	 * 
	 * @author liyuxin
	 * @param roleId
	 * @return
	 * @throws GenericException
	 */
	public RolePo findRole(Long roleId) throws GenericException;

	public RolePo findRoleByCompanyIdForSupplier(int companyId) throws GenericException;

	/**
	 * 通过角色ID查找菜单
	 * 
	 * @author liyuxin
	 * @param roleId
	 * @return
	 * @throws GenericException
	 */
	public List<RoleMenuPo> findMenusByRole(Long roleId) throws GenericException;

	/**
	 * 更新角色菜单
	 * 
	 * @author liyuxin
	 * @param roleVo
	 * @param menuIds
	 * @throws GenericException
	 */
	public void updateRoleMenu(RoleVo roleVo) throws GenericException;

	/**
	 * 删除角色及角色菜单中间表
	 * 
	 * @author liyuxin
	 * @param roleVo
	 * @throws GenericException
	 */
	public void deleteRoleMenu(Long roleId) throws GenericException;

	/**
	 * 获取用户角色关系列表
	 * 
	 * @author liyuxin
	 * @param roleId
	 * @return
	 * @throws GenericException
	 */
	public List<UserRolePo> findUserRoles(Long roleId) throws GenericException;

	public List<RolePo> getRolePoByRoleNameUserId(UserPo userPo, String roleName) throws GenericException;

	public String getAllMenuJson(int id) throws GenericException;

	public String getAllMenuJson(String menuIdAll) throws GenericException;

}
